package com.ebeitech.doorapp.http.service;

import com.ebeitech.doorapp.BuildConfig;

import java.util.Map;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * Created by alice on 2017/10/26.
 */
public interface HttpCommonServiceRx {

	/**
	 * 登陆
	 */
	@FormUrlEncoded
	@POST("auth/oauth/token")
	Call<ResponseBody> doLogin(@FieldMap Map<String, String> params);

	/**
	 * 返回个人信息
	 */
	@GET("platform/user/info")
	Call<ResponseBody> getUserInfo();

	/**
	 * 修改密码
	 */
	@POST
	Call<ResponseBody> changePassword(@Url String url, @Body Map<String, String> params);

	/**
	 * 小米华为推送绑定
	 * @param params
	 * @return
	 */
	@FormUrlEncoded
	@POST(BuildConfig.serverMqttProxy + "redis_Redis_device.do")
	Call<ResponseBody> doBindPush(@FieldMap Map<String, String> params);

	/**
	 * 小米华为推送解绑
	 * @param params
	 * @return
	 */
	@FormUrlEncoded
	@POST(BuildConfig.serverMqttProxy + "redis_Redis_device.do")
	Call<ResponseBody> doUnBindPush(@FieldMap Map<String, String> params);

	/**
	 * 下载文件
	 * @return
	 */
	@GET
	Call<ResponseBody> downloadFile(@Url String url);

	/**
	 * app自动检查新版本
	 * @param params
	 * @return
	 */
	@GET("rest/version/check")
	Call<ResponseBody> checkVersion(@QueryMap Map<String, String> params);

}
